<template>
  <u-form labelWidth="auto" disabled>
    <view>
      <view style="display: flex">
        <view>
          <view class="option" style="width: 520rpx">
            <view class="lf">款项名称</view>
            <view class="rl">{{ item.nodeName }}</view>
          </view>

          <view class="option" style="width: 520rpx">
            <view class="lf">金额(元)</view>
            <view class="rl">{{ item.paymentMoney }}</view>
          </view>

          <view class="option" style="width: 520rpx">
            <view class="lf">款项节点说明</view>
            <view class="rl">{{ item.nodeDesc }}</view>
          </view>
          <!-- <view class="option" style="width: 520rpx">
            <view class="lf">是否关联任务</view>
            <view class="rl">
              {{
                item.isRelatedTask === null || item.isRelatedTask === '' || item.isRelatedTask === undefined
                  ? ''
                  : item.isRelatedTask == 1
                  ? '是'
                  : '否'
              }}
            </view>
          </view> -->
          <!-- <view class="option" style="width: 520rpx" v-if="item.isRelatedTask == 1">
            <view class="lf">是否关联进度</view>
            <view class="rl">
              {{
                item.isRelatedTaskNode === null || item.isRelatedTaskNode === '' || item.isRelatedTaskNode === undefined
                  ? ''
                  : item.isRelatedTaskNode == 1
                  ? '是'
                  : '否'
              }}
            </view>
          </view> -->
          <view class="option" style="width: 520rpx">
            <view class="lf">本任务关联款项金额(元)</view>
            <view class="rl">{{ item.taskPaymentMoney }}</view>
          </view>
					<view class="option" style="width: 520rpx">
            <view class="lf">任务进度</view>
            <view class="rl">{{ item.taskNodeId_dictText?item.taskNodeId_dictText:item.taskNodeId }}</view>
          </view>
					<view class="option" style="width: 520rpx">
            <view class="lf">节点进度(%)</view>
            <view class="rl">{{ item.taskProgress }}</view>
          </view>
          <!-- <template v-if="isShow">
          	<view class="option" style="width: 520rpx" v-if="item.isRelatedTask == 1">
          	  <view class="lf">是否应收</view>
          	  <view class="rl">
          	    {{
          	      item.isCollectionPayment === null || item.isCollectionPayment === '' || item.isCollectionPayment === undefined
          	        ? ''
          	        : item.isCollectionPayment == 1
          	        ? '是'
          	        : '否'
          	    }}
          	  </view>
          	</view>
          	<view class="option" style="width: 520rpx" v-if="item.isCollectionPayment == 1">
          	  <view class="lf">预计应收日期</view>
          	  <view class="rl">{{ item.collectionDate }}</view>
          	</view>
          </template> -->
        </view>

        <view style="flex: 1; display: flex; align-items: center; justify-content: flex-end" v-if="!disabled">
          <!-- <u-icon name="edit-pen-fill" color="#2979ff" size="20" @click="handleEidtForm(item, index)"></u-icon> -->
					<text :style="item.shouldPayFlag !='1'?'color:#2979ff':'color:rgba(0, 0, 0, 0.25)'" @click="handleEidtForm(item, index)">完善</text>
        </view>
      </view>
    </view>

    <!-- <u-form-item label="款项名称" prop="nodeName">
      <u--input disabled border="none" placeholder="请输入款项名称" v-model="item.nodeName"></u--input>
    </u-form-item>
    <u-form-item label="金额(元)" prop="paymentMoney">
      <u--input disabled border="none" type="number" v-number-normal placeholder="请输入金额" v-model="item.paymentMoney"></u--input>
    </u-form-item>
    <u-form-item label="款项节点说明" prop="nodeDesc">
      <u--textarea
        disabled
        border="none"
        maxlength="500"
        confirm-type="send"
        v-model="item.nodeDesc"
        placeholder="请输入款项节点说明"
      ></u--textarea>
    </u-form-item>
    <u-form-item label="是否关联任务" prop="isRelatedTask" required>
      <h-select-input-tag
        disabled
        class="w-100"
        v-model="item.isRelatedTask"
        objectField="item.isRelatedTask"
        placeholder="请选择是否关联任务"
        border="none"
        dictName="YES_OR_NO"
        @back="relatedTaskInput"
      ></h-select-input-tag>
    </u-form-item>
    <template v-if="item.isRelatedTask == 1">
      <u-form-item label="是否关联进度" prop="isRelatedTaskNode" required>
        <h-select-input-tag
          disabled
          class="w-100"
          v-model="item.isRelatedTaskNode"
          objectField="item.isRelatedTaskNode"
          placeholder="请选择是否关联进度"
          border="none"
          dictName="YES_OR_NO"
          @back="collectionDateInput"
        ></h-select-input-tag>
      </u-form-item>
    </template>
    <template v-if="item.isRelatedTask == 1">
      <u-form-item label="任务进度" prop="taskNodeId" required>
        <selectTaskProgressInput
          disabled
          style="width: 100%"
          v-model="item.taskNodeId"
          :progressVoList="progressVoList"
          objectField="item.templateId"
          placeholder="请选择任务进度"
          border="none"
          suffixIcon="arrow-down-fill"
          :suffixIconStyle="{ color: '#B2B2B2' }"
        ></selectTaskProgressInput>
      </u-form-item>
    </template>
    <u-form-item label="是否应收" prop="isCollectionPayment" required>
      <h-select-input-tag
        disabled
        class="w-100"
        v-model="item.isCollectionPayment"
        objectField="item.isCollectionPayment"
        placeholder="请选择是否应收"
        border="none"
        dictName="YES_OR_NO"
      ></h-select-input-tag>
    </u-form-item>
    <template v-if="item.isCollectionPayment == 1">
      <u-form-item label="应收日期" prop="collectionDate" required>
        <h-time-select
          disabled
          mode="datetime"
          v-model="item.collectionDate"
          placeholder="请选择应收日期"
          border="none"
          suffixIcon="calendar-fill"
          :suffixIconStyle="{ color: '#B2B2B2' }"
        ></h-time-select>
      </u-form-item>
    </template> -->

    <!-- <view class="trip-form-action flex space-x-1" v-if="!disabled"> -->
    <!-- <view @click.stop.prevent="handleCopyForm(item)">
        <u-button size="small" type="primary">复制</u-button>
      </view> -->
    <!-- <view @click.stop.prevent="handleEidtForm(item)">
        <u-button size="small" type="primary">完善</u-button>
      </view> -->
    <!-- <view @click.stop.prevent="handleRemoveForm(item)">
        <u-button size="small" type="error">删除</u-button>
      </view> -->
    <!-- </view> -->
  </u-form>
</template>

<script>
import { filterMultiDictText, initDictOptions } from '@/utils/JDictSelectUtil.js'
import selectTaskProgressInput from '@/pages/synergy/components/selectTaskProgressInput.vue'

export default {
  name: 'PriceFormInfo',
  components: {
    selectTaskProgressInput,
  },
  props: {
    index: {
      type: Number,
      default: null,
    },
    item: {
      type: Object,
      default: () => ({}),
    },
    progressVoList: {
      type: Array,
      default: () => [],
    },
    disabled: {
      type: Boolean,
      default: false,
    },
		isShow: {
      type: Boolean,
      default: true,
    },
  },
  data() {
    return {
      filterMultiDictText,
      initDictOptions,
      dictOptions: {},
      smallList: [],
    }
  },
  watch: {
    item: {
      handler(val) {},
      immediate: true,
      deep: true,
    },
  },
  methods: {
    handleCopyForm(item) {
      this.$emit('copy', [item, this.index])
    },
    handleEidtForm(item) {
			if (item.shouldPayFlag == '1') {
				return
			}
      this.$emit('edit', [item, this.index])
    },
    handleRemoveForm(item) {
      this.$emit('remove', item)
    },
  },
}
</script>

<style scoped lang="scss">
.inforamtion {
  margin-top: 10rpx;
  padding: 10rpx;
  border-radius: 15rpx;
  box-shadow: 0px 4px 20px 0px rgba(0, 0, 0, 0.1);
}
</style>
